package com.hp.TrimClient;

import java.net.FileNameMap;
import java.net.URLConnection;

public class FileUtils {
	  public static String getMimeType(String fileUrl)		     
	    {
	      FileNameMap fileNameMap = URLConnection.getFileNameMap();
	      String type = fileNameMap.getContentTypeFor(fileUrl);

	      if (type == null) {
	    	  type = "application/octet-stream";
	      }
	      return type;
	    }

//		    public static void main(String args[]) throws Exception {
//		      System.out.println(FileUtils.getMimeType("file://c:/temp/test.TXT"));
//		      // output :  text/plain
//		    }
}
